home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / icons+tools / iconian / sources / emodules / mod / fonts.e < prev    next >
Text File  |  1995-12-22  |  1KB  |  40 lines

  1. OPT MODULE
  2. OPT EXPORT
  3.  
  4. MODULE    'graphics','graphics/text','graphics/gfx'
  5. MODULE    'mod/compare'
  6.  
  7. PROC fontsize2(rast,str,textfont2:PTR TO textfont,style)
  8.     DEF w=0,h=0,xor=0
  9.     DEF textextent:PTR TO textextent
  10.     NEW textextent
  11.     IF ((textfont2<>0) AND (rast<>0))
  12.         xor:=xor OR (IF ((textfont2.style AND 1)<>(style AND 1)) THEN 1 ELSE 0)
  13.         xor:=xor OR (IF ((textfont2.style AND 2)<>(style AND 2)) THEN 2 ELSE 0)
  14.         xor:=xor OR (IF ((textfont2.style AND 4)<>(style AND 4)) THEN 4 ELSE 0)
  15.         SetFont(rast,textfont2)
  16.         SetSoftStyle(rast,xor,7)
  17.         TextExtent(rast,str,StrLen(str),textextent)
  18.  
  19.         w:=Abs(textextent.extent.minx)+Abs(textextent.extent.maxx)+1
  20.         h:=Abs(textextent.extent.miny)+Abs(textextent.extent.maxy)+1
  21.  
  22.  
  23. /*        IF xor AND FSF_BOLD THEN w:=w+1
  24.         IF xor AND FSF_UNDERLINED THEN w:=w+2
  25.         IF xor AND FSF_ITALIC THEN w:=w+4*/
  26.     ENDIF
  27.     END textextent
  28. ENDPROC w,h
  29.  
  30. PROC biggest(rast,tags:PTR TO LONG,textfont,style)
  31.     DEF w=0,h=0,nw,nh
  32.     WHILE tags[0]<>0
  33.         nw,nh:=fontsize2(rast,tags[0],textfont,style)
  34.         w:=bigger(w,nw)
  35.         h:=bigger(h,nh)
  36.         tags:=tags+4
  37.     ENDWHILE
  38. ENDPROC w,h
  39.  
  40.